age = 23

if age > 18:
    print("成年")
elif age == 18:
    print("刚好成年")
else:
    print("未成年")

l = [1, 2, 3, 4, 5, 6, 7, 8]

#  获取下标 enumerate
for i, item in enumerate(l):
    print(i, item)

# 10的阶乘

i = 0
sum = 1

while i <= 10:
    i += 1
    sum *= i

print(sum)

# 列表推导式

l = [1, 2, 3, 4, 5, 6, 7, 8]

l2 = []
for i in l:
    l2.append(i * 2)

print(l2)

# 简写
l2 = [i * 2 for i in l]
print(l2)
